﻿<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    CodeFile="Article.aspx.cs" Inherits="V_FactoryManagement_Building" ValidateRequest="false" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Assembly="Fetco.Framework" Namespace="FetCo.Web.UI.WebControls" TagPrefix="FetCo" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="titlePlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="menuPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentPlaceHolder" runat="Server">
    <table width="100%">
        <tr>
            <td>
                <div style="padding-bottom: 7px;">
                    <div class="divfirst1" style="width: 130px">
                        <%=Utilitys.Dictionary["Titlevn"]%>
                        <span style="color: Red;">(*)</span>:
                    </div>
                    <div class="divlast1">
                        <asp:TextBox ID="txtName" MaxLength="100" runat="server" Width="561px"></asp:TextBox></div>
                </div>
            </td>
        </tr>
        <tr>
            <td style="height: 8px">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <div style="padding-bottom: 7px;">
                            <div class="divfirst1" style="width: 130px">
                                <%=Utilitys.Dictionary["Category"]%>
                                <span style="color: Red;">(*)</span>:
                            </div>
                            <div class="divlast1">
                                <asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddCategory_OnSelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:CustomValidator ID="cusDepartment" runat="server" ClientValidationFunction="ddlCategory">*</asp:CustomValidator></div>
                        </div>
                        <div style="padding-bottom: 7px;">
                            <div class="divfirst1" style="width: 130px">
                                <%=Utilitys.Dictionary["SubCategory"]%>
                                :
                            </div>
                            <div class="divlast1">
                                <asp:DropDownList ID="ddlSubCat" runat="server">
                                </asp:DropDownList></div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td colspan="3">
                <div>
                    <div class="divfirst1" style="width: 130px">
                        <%=Utilitys.Dictionary["UploadImages"]%>
                        :
                    </div>
                    <div style="float: left; padding-right: 7px;">
                        <asp:FileUpload runat="server" ID="UL_Picture" /></div>
                    <div style="float: left; padding-right: 7px;">
                    </div>
                </div>
                <div style="clear: left; padding-top: 12px; padding-left: 11px">
                    <table cellpadding="2" cellspacing="0" width="100%">
                        <tr>
                            <td>
                                <div style="vertical-align: middle;">
                                    <div class="label" style="float: left; width: 130px;">
                                        &nbsp;</div>
                                    <div class="divlast1">
                                        <asp:Image runat="server" ID="img" CssClass="img" /><asp:Button ID="btnDeleteImg"
                                            OnClick="btnDeleteImg_OnClick" runat="server" Text="Xoá hình" /></div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
                <div style="padding-top: 2px;">
                    <div class="divfirst1" style="width: 130px">
                        <label>
                            <%=Utilitys.Dictionary["Summary"]%>
                        </label>
                    </div>
                    <div style="text-align: left; padding-left: 14px;">
                        <FCKeditorV2:FCKeditor ID="fck_SummaryVn" runat="server" BasePath="~/Javascripts/FCKEditor/"
                            ToolbarCanCollapse="false" Width="600px" Height="250px" ToolbarSet="RTI">
                        </FCKeditorV2:FCKeditor>
                    </div>
                </div>
                <div style="padding-top: 32px;">
                    <div class="divfirst1" style="width: 130px">
                        <label>
                            <%=Utilitys.Dictionary["Content"]%>
                        </label>
                    </div>
                    <div style="text-align: left; padding-left: 14px;">
                        <FCKeditorV2:FCKeditor ID="fck_ContentVn" runat="server" BasePath="~/Javascripts/FCKEditor/"
                            ToolbarCanCollapse="false" Width="600px" Height="500px" ToolbarSet="RTI">
                        </FCKeditorV2:FCKeditor>
                    </div>
                </div>
            </td>
        </tr>
    </table>
    <div style="padding: 7px;">
        <asp:Literal ID="lb_error" runat="server"></asp:Literal>
    </div>
    <%--             var error=document.getElementById("<%=txtName.ClientID%>");--%>
    <div style="padding-left: 144px;">

        <script type="text/javascript">
         function checkError()
            {

                 var ddl=document.getElementById("<%=ddlSubCat.ClientID%>");
                 
                 if(ddl.value=='0')
                 {
                    alert('Bạn chưa chọn danh mục con !');
                    return false;
                 }
                 else
                 {
                    return true;
                 }
                
            }
        </script>

        <asp:Button runat="server" ID="btnDangBai" CssClass="bbutton" CausesValidation="false" Text="Đăng bài"
            OnClick="btnDangBai_OnClick" OnClientClick="return checkError()" />&nbsp;&nbsp;
    </div>
    <div style="color: Red;" align="center">
        <asp:Literal runat="server" ID="ltrmessage" />
    </div>

    <script type="text/javascript">
       
      
           function CheckAll(obj)
            {
                 // find any item not check
                    var countUncheck = 0;
                    var checkAll = true;
                    var checkList = document.getElementsByTagName("input");
                    if(!obj.checked)
                    checkAll = false;
                    for(var i = 0 ; i < checkList.length ; i++)
                    { 
                        if(checkList[i].type == 'checkbox' && checkList[i].id.indexOf("ckbDelete") >= 0 )
                        {
                        checkList[i].checked = checkAll;
                        }
                    } 
            }
    </script>

</asp:Content>
